package com.renli.controller;


import com.renli.bean.ResultJson;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class ExceptionController {
    @RequestMapping("/unauthorizedUrl")
    public ResultJson getUnauthorizedUrl(){
         return   new ResultJson().setFail("未授权,无权访问");
    }

    @RequestMapping("/notLogin")
    public  ResultJson   notLogin(HttpServletRequest  request){//  未登录
        System.out.println("--------------------");
        return   new ResultJson().setFail((String)request.getAttribute("msg"));
    }

}
